<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use frontend\models\FenhuiForm;
use common\models\articles\Articles;
use yii\captcha\Captcha;
use yii\helpers\Url;

$this->title = '申请入会';
$this->params['breadcrumbs'][] = $this->title;
$ar = Articles::find()->where(['category_id'=>37])->one();
?>
<div class="w1113" style="background:#fff;">
     <div id="V_left">
     
        <div class="Tou">
            <span><img src="../../images/Tou.jpg"></span><font>您好，<?=$member['username'];?></font>
            <div style="clear:both"></div>
        </div>
     
     
        <ul id="Accordion" class="Accordion">
            <li class="lia">
                <div class="link"><i class="fa fa-paint-brush"><img src="../../images/V_01.png"></i>修改会员资料</div>
                
            </li>
            <li class="lia">
                <div class="link"><i class="fa fa-code"><img src="../../images/V_02.png"></i>会员升级</div>
                <ul class="submenu">
                    <li><a href="#">申请成为理事</a></li>
                    <li><a href="#">申请成为常务理事</a></li>
                    <li><a href="#">申请成为副会长</a></li>
                </ul>
            </li>
            <li class="lia">
                <div class="link"><i class="fa fa-mobile"><img src="../../images/V_03.png"></i>加入分会</div>
                <ul class="submenu">
                    <?php foreach($fenhuis as $fh){ ?>
                        <li><a <?php if ($id == $fh['id']){ ?> style="color:#c40400 " <?php } ?> href="<?=yii\helpers\Url::to(['member/applyone','id'=>$fh['id']]);?>"><?=$fh['name'];?></a></li>
                    <?php } ?>
                </ul>
            </li>
            <li class="lia"><div class="link"><i class="fa fa-globe"><img src="../../images/V_04.png"></i>会议展览报名</div>
                <ul class="submenu">
                    <li><a href="#">会议</a></li>
                    <li><a href="#">防水展</a></li>
                </ul>
            </li>
            <li class="lia">
                <div class="link"><i class="fa fa-paint-brush"><img src="../../images/V_05.png"></i>认证、奖项申请</div>
                
            </li>
            <li class="lia">
                <div class="link"><i class="fa fa-paint-brush"><img src="../../images/V_06.png"></i>月度统计</div>
                
            </li>
            <li class="lia">
                <div class="link"><i class="fa fa-paint-brush"><img src="../../images/V_07.png"></i>出国考察</div>
                
            </li>
            <li class="lia">
                <div class="link"><i class="fa fa-paint-brush"><img src="../../images/V_08.png"></i>会员缴费</div>
                
            </li>
            <li class="lia"><div class="link"><i class="fa fa-globe"><img src="../../images/V_09.png"></i>发票管理</div>
                <ul class="submenu">
                    <li><a href="#">发票索取</a></li>
                    <li><a href="#">发票列表</a></li>
                    <li><a href="#">发票信息管理</a></li>
                    <li><a href="#">发票寄送地址管理</a></li>
                    
                </ul>
            </li>
            <li class="lia">
                <div class="link"><i class="fa fa-paint-brush"><img src="../../images/V_10.png"></i>修改密码</div>
                
            </li>
        </ul>
                  
     </div>
     <div id="V_right">
          <div class="A_title">
               <h3>注意事项：</h3>
               <ul>
                  <li>1、请在网上填写“会员登记表”并打印一份，首页盖公章，法人签字加盖公章；入会还需提供以下资料：公司营业执照复印件加盖公章；
税务登记证复印件加盖公章。</li>
                  <li>2、会费：实行年费制（自然年）第一年2500元，我们会开具：“全国性社会团体会费统一收据”。</li>
                  <li>3、如果公司法人或公司地址等信息有变动，请在网站上修改提交联合会审核。</li>
               </ul>
          </div>
          
          <div class="V_input">
               <h3 class="V_tle">申请入会：</h3>
               <img class="V_tpic" src="../../images/Vip2.png">
               <p class="V_pp"><span style="color:#c40400;">设置基本信息</span><span class="b" style="color:#c40400;">营业执照信息</span><span style="color:#c40400;">详细信息</span></p>
              <label style="color: red">
                  <?php
                  if(\Yii::$app->getSession()->getFlash("success")) {
                      echo \Yii::$app->getSession()->getFlash("success");
                  }
                  ?>
              </label>
              <form id="login-form" action="/member/applythree/<?=$id;?>" enctype="multipart/form-data"  method="post" role="form">
                  <input type="hidden" name="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
               <div class="V_app">
                  <label style="float:left;"><font>*</font> 经营模式：</label>

						<select tabindex="6"  name="jymoshi" class="dropdown" data-settings='{"cutOff": 12}'>
							<option value="" class="label">--- 经营模式 ---</option>
							<option value="自产自销"<?php if ($info['jymoshi'] =="自产自销" ){?> selected <?php }?>>自产自销</option>
							<option value="代购代销"<?php if ($info['jymoshi'] =="代购代销" ){?> selected <?php }?>>代购代销</option>
							<option value="批发"<?php if ($info['jymoshi'] =="批发" ){?> selected <?php }?>>批发</option>
							<option value="零售"<?php if ($info['jymoshi'] =="零售" ){?> selected <?php }?>>零售</option>
							<option value="运输业"<?php if ($info['jymoshi'] =="运输业" ){?> selected <?php }?>>运输业</option>
							<option value="咨询服务"<?php if ($info['jymoshi'] =="咨询服务" ){?> selected <?php }?>>咨询服务</option>

						</select>
                    <div style="clear:both"></div>
               </div>
               <p class="V_app"><label><font>*</font>企业品牌：</label><input value="<?=$info['qiyepinpai'];?>"  name="qiyepinpai" type="text"></p>
               
               
               
               <p class="V_app"><label><font>*</font>代理品牌：</label><input value="<?=$info['dailipinpai'];?>" name="dailipinpai" type="text"></p>
               <p class="V_app"><label><font>*</font>本科及以上人数：</label><input value="<?=$info['bennum'];?>" name="bennum" type="text"></p>
               <p class="V_app"><label><font>*</font>职工人数：</label><input value="<?=$info['qiyerenshu'];?>" name="qiyerenshu" type="text"></p>

               <div class="V_app">
                  <label style="float:left;"><font>*</font>外销比例：</label>
                  
						<select tabindex="6" name="waixiao" class="dropdown" data-settings='{"cutOff": 12}'>

							<option value="" class="label">--- 请选择---</option>

							<option value="20%以下"<?php if ($info['waixiao'] =="20%以下" ){?> selected <?php }?>>20%以下</option>

							<option value="20%-40%"<?php if ($info['waixiao'] =="20%-40%" ){?> selected <?php }?>>20%-40%</option>

							<option value="40%-70%"<?php if ($info['waixiao'] =="40%-70%" ){?> selected <?php }?>>40%-70%</option>

							<option value="70%以上"<?php if ($info['waixiao'] =="70%以上" ){?> selected <?php }?>>70%以上</option>

						</select>
                    <div style="clear:both"></div>                   
               </div>
               <div class="V_app">
                  <label style="float:left;"><font>*</font>企业产品种类：</label>
                  
						<select tabindex="6" name="chanpinzl" class="dropdown" data-settings='{"cutOff": 12}'>

                            <option value="" class="label">--- 请选择---</option>

							<option value="刚性防水"<?php if ($info['chanpinzl'] =="刚性防水" ){?> selected <?php }?>>刚性防水</option>

							<option value="卷材防水"<?php if ($info['chanpinzl'] =="卷材防水" ){?> selected <?php }?>>卷材防水</option>

							<option value="涂料类"<?php if ($info['chanpinzl'] =="涂料类" ){?> selected <?php }?>>涂料类</option>

							<option value="结晶类"<?php if ($info['chanpinzl'] =="结晶类" ){?> selected <?php }?>>结晶类</option>

							<option value="涂膜类"<?php if ($info['chanpinzl'] =="涂膜类" ){?> selected <?php }?>>涂膜类</option>

						</select>
                    <div style="clear:both"></div>                   
               </div>
               
               <div class="V_app">
                  <label style="float:left;"><font>*</font>是否参加过政府采购投标：</label>
                  
						<select tabindex="6" name="toubiao" class="dropdown" data-settings='{"cutOff": 12}'>

                            <option value="" class="label">--- 请选择---</option>
							<option value="参加过"<?php if ($info['toubiao'] =="参加过" ){?> selected <?php }?>>参加过</option>
							<option value="未参加过"<?php if ($info['toubiao'] =="未参加过" ){?> selected <?php }?>>未参加过</option>
						</select>
                    <div style="clear:both"></div>                   
               </div>
                <div class="V_app">
                     <div class="updiv">
                          <input type="submit" value="保存，下一步" class="up_sub" />
                         
                      </div>
                </div>
              </form>
          </div>

     </div>
     <div style="clear:both"></div>
</div>

<script type="text/javascript">
$(document).ready(function() {
	$(".Select").each(function(){
		var s=$(this);
		var z=parseInt(s.css("z-index"));
		var dt=$(this).children("dt");
		var dd=$(this).children("dd");
		var _show=function(){dd.slideDown(200);dt.addClass("cur");s.css("z-index",z+1);};   //展开效果
		var _hide=function(){dd.slideUp(200);dt.removeClass("cur");s.css("z-index",z);};    //关闭效果
		dt.click(function(){dd.is(":hidden")?_show():_hide();});
		dd.find("a").click(function(){dt.html($(this).html());_hide();});     //选择效果（如需要传值，可自定义参数，在此处返回对应的“value”值 ）
		$("body").click(function(i){ !$(i.target).parents(".Select").first().is(s) ? _hide():"";});
	})
})
</script>

<script>
//获取上传按钮
var input1 = document.getElementById("upload"); 
 
if(typeof FileReader==='undefined'){ 
     //result.innerHTML = "抱歉，你的浏览器不支持 FileReader"; 
     input1.setAttribute('disabled','disabled'); 
}else{ 
     input1.addEventListener('change',readFile,false); 
     /*input1.addEventListener('change',function (e){
     	console.log(this.files);//上传的文件列表
     },false); */
}
function readFile(){ 
	var file = this.files[0];//获取上传文件列表中第一个文件
	if(!/image\/\w+/.test(file.type)){
	//图片文件的type值为image/png或image/jpg
		alert("文件必须为图片！");
		return false; 
	} 
	// console.log(file);
	var reader = new FileReader();//实例一个文件对象
	reader.readAsDataURL(file);//把上传的文件转换成url
	//当文件读取成功便可以调取上传的接口
	reader.onload = function(e){ 
		// console.log(this.result);//文件路径
		// console.log(e.target.result);//文件路径
		/*var data = e.target.result.split(',');
		var tp = (file.type == 'image/png')? 'png': 'jpg';
		var imgUrl = data[1];//图片的url，去掉(data:image/png;base64,)
		//需要上传到服务器的在这里可以进行ajax请求
		// console.log(imgUrl);
		// 创建一个 Image 对象 
		var image = new Image();
		// 创建一个 Image 对象 
		// image.src = imgUrl;
		image.src = e.target.result;
		image.onload = function(){
			document.body.appendChild(image);
		}*/

		var image = new Image();
		// 设置src属性 
		image.src = e.target.result;
		var max=200;
		// 绑定load事件处理器，加载完成后执行，避免同步问题
		image.onload = function(){ 
			// 获取 canvas DOM 对象 
			var canvas = document.getElementById("cvs"); 
			// 如果高度超标 宽度等比例缩放 *= 
			/*if(image.height > max) {
				image.width *= max / image.height; 
				image.height = max;
			} */
			// 获取 canvas的 2d 环境对象, 
			var ctx = canvas.getContext("2d"); 
			// canvas清屏 
			ctx.clearRect(0, 0, canvas.width, canvas.height); 
			// 重置canvas宽高
			/*canvas.width = image.width;
			canvas.height = image.height;
			if (canvas.width>max) {canvas.width = max;}*/
			// 将图像绘制到canvas上
			// ctx.drawImage(image, 0, 0, image.width, image.height);
			ctx.drawImage(image, 0, 0, 150, 150);
			// 注意，此时image没有加入到dom之中
		};  
	}
};
</script>

